package com.example.pathprotectsystem.mapper;

import com.example.pathprotectsystem.pojo.PathLevelModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EvaluateMapper {

    @Select("select group_concat(finishTime) as finishTime," +
            "group_concat(pavementdamage.damageArea/pavementdamage.allLongth/pavementdamage.allWidth) as pqiLevel," +
            "group_concat(damageType) as damageTypes from pavementdamage " +
            "join task on task.id = pavementdamage.taskId " +
            "join path on task.pathId = path.id " +
            "group by path.pathName,left(pavementdamage.finishTime,7) " +
            "having pathName = #{pathName}")
    List<PathLevelModel> getpathlevelPCIall(String pathName);


    @Select("select group_concat(finishTime) as finishTime," +
            "group_concat(iri) as pqiLevel from pavementflat " +
            "join task on task.id = pavementflat.taskId " +
            "join path on task.pathId = path.id " +
            "group by path.pathName,left(pavementflat.finishTime,7) " +
            "having pathName = #{pathName}")
    List<PathLevelModel> getpathlevelIRIall(String pathName);
}
